#ifndef USBWIDGET_H
#define USBWIDGET_H

#include <QWidget>

#include <QTimer>

#include <QList>

namespace Ui {
class usbWidget;
}
struct usbInfoData{

    quint16 vid;
    quint16 pid;
    QString manufacturer;
    QString product;
    QList <quint8> inPoint;
    QList <quint8> outPoint;

};

class usbWidget : public QWidget
{
    Q_OBJECT

public:
    explicit usbWidget(QWidget *parent = nullptr);
    ~usbWidget();

    int  scanUsbPort();
    int  openUsbPort(int _index);

private slots:
    void usbDataUpdate();

    void on_usbScanPushButton_clicked();

    void on_usbOpenPushButton_clicked();

private:
    Ui::usbWidget *ui;

    quint8      usbStatus,usbIndex;
    QList <usbInfoData> usbInfo;

    QTimer      *usbTimer;

};

#endif // USBWIDGET_H
